/**
 * Created by user on 2/15/19.
 */
import React from 'react'
import { connect } from 'react-redux'
import { QuestionAction } from '@act'


class QuestionEntry extends React.Component {
  clickIt = () => {
    const { dispatch } = this.props
    const { toggleShow } = QuestionAction
    dispatch(toggleShow(true))
  }
  render() {
    const { type } = this.props
    return (
      <div onClick={this.clickIt} className="out_dm_other_list_icon_out">
        <img className="out_dm_other_list_icon" src={require('@images/question/live_question_list_icon.png')} alt=""/>
        { type === 'qa' ? <div className="out_dm_other_list_text">提问列表</div> : null }
      </div>
    )
  }
}

function mapState(state) {
  return state
}

export default connect(mapState)(QuestionEntry)
